package com.liwenfeng.diancanspringboot.mapper;

import com.github.pagehelper.Page;
import com.liwenfeng.diancanspringboot.annotation.AutoFill;
import com.liwenfeng.diancanspringboot.common.enumeration.OperationType;
import com.liwenfeng.diancanspringboot.pojo.dto.StatementDTO;
import com.liwenfeng.diancanspringboot.pojo.entity.Statement;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StatementMapper {
    // 没用 todo
    Page<Statement> selectByPage(StatementDTO statementDTO);

    @AutoFill(OperationType.INSERT)
    void insert(Statement statement);

    @AutoFill(OperationType.UPDATE)
    void update(Statement statement);

    @Select("select * from statement where turnover_id = #{turnoverId}")
    List<Statement> getByTurnoverId(Long turnoverId);
}
